package com.jiang.daily.Q3264;

/**
 * @author Jiang
 * @version 1.0
 * @date 2024/12/13 18:43
 */
class Solution {
    public int[] getFinalState(int[] nums, int k, int multiplier) {
        for (int i = 0; i < k; i++) {
            int index = minIndex(nums);
            nums[index] *= multiplier;
        }
        return nums;
    }

    public int minIndex(int[] nums) {
        int temp = nums[0];
        int index = 0;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] < temp) {
                temp = nums[i];
                index = i;
            }
        }
        return index;
    }
}
